<template>
	<view class="padding30">
		<u-form :model="form" ref="uForm" label-position ='top' :label-style='labelStyle'>
			<u-form-item label="姓名">
				<u-input v-model="form.card_name" placeholder='请输入持卡人姓名'/>
			</u-form-item>
			<u-form-item label="持卡人手机号">
				<u-input v-model="form.card_phone" placeholder='请输入持卡人手机号' type='number'/>
			</u-form-item>
			<u-form-item label="银行名称">
				<u-input v-model="form.bank_name" placeholder='请输入银行名称'/>
			</u-form-item>
			<u-form-item label="银行卡号">
				<u-input v-model="form.bank_card_no" placeholder='请输入银行卡号' type='number'/>
			</u-form-item>
		</u-form>
		
		<!-- 底部按钮 -->
		<view class="fw-500 footerBtn pl30 pr30 bg-f pt20 pb70">
			<u-button type="primary" shape="circle" @click="submit">立即绑定</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					card_name:uni.getStorageSync('userInfo').card_name || '',
					card_phone:uni.getStorageSync('userInfo').card_phone || '',
					bank_name:uni.getStorageSync('userInfo').bank_name || '',
					bank_card_no:uni.getStorageSync('userInfo').bank_card_no || ''
				},
				labelStyle:{
					fontSize: '24rpx',
					fontFamily: 'PingFangSC-Medium, PingFang SC',
					fontWeight: '700',
					color: '#333333',
				}
			};
		},
		methods:{
			submit() {
				this.$api.binding_bank_card(this.form).then(res=>{
					console.log(res)
					this.$msg(res.msg)
					setTimeout(()=>{
						uni.navigateBack({
							
						})
					},500)
				})
			}
		}
	}
</script>

<style lang="scss">
page {
	background-color: #FFFFFF;
}
</style>
